/*
 * Application: NodeList for Two Way GB2312.
 *
 * Created by GF on 2023/3/10.
 */

#include <stdio.h>
#include "C_INCLUDE/NodeList_for_Two_Way_GB2312.h"

/* run this program using the console pauser or add your own getch, system("pause") or input loop */

int main(int argc, char *argv[]) {

    struct Node_2W* Temp = NodeList_2W_Node_Init();

    printf("***************************** NodeList 2W Append Node and Assign Test ******************************\n");

    NodeList_2W_Append_Node_and_Assign(Temp, "1");
    NodeList_2W_Append_Node_and_Assign(Temp, "2");
    NodeList_2W_Append_Node_and_Assign(Temp, "3");
    NodeList_2W_Print_as_List(Temp);
    printf("Length of Current NodeList 2W: %d\n", NodeList_2W_Get_Length(Temp));

    printf("***************************** NodeList 2W Insert Node And Assign Test ******************************\n");

    NodeList_2W_Insert_Node_and_Assign(Temp, 1, "7");
    NodeList_2W_Insert_Node_and_Assign(Temp, 1, "8");
    NodeList_2W_Insert_Node_and_Assign(Temp, 1, "9");
    NodeList_2W_Print_as_List(Temp);
    printf("Length of Current NodeList 2W: %d\n", NodeList_2W_Get_Length(Temp));

    printf("************************************** NodeList 2W Clear Test **************************************\n");

    NodeList_2W_Clear(Temp);
    NodeList_2W_Print_as_List(Temp);
    printf("Length of Current NodeList 2W: %d\n", NodeList_2W_Get_Length(Temp));

    return 0;
}
